package org.dfzt.modules.online.cgform.converter.bb;

import java.util.ArrayList;
import java.util.List;

import org.dfzt.common.system.service.ISysBaseAPI;
import org.dfzt.common.util.SpringContextUtils;
import org.dfzt.common.util.oConvertUtils;
import org.dfzt.modules.online.cgform.converter.aa.b;
import org.dfzt.modules.online.cgform.entity.OnlCgformField;


public class i
        extends b {
    public i(OnlCgformField paramOnlCgformField) {
        ISysBaseAPI iSysBaseAPI = (ISysBaseAPI) SpringContextUtils.getBean(ISysBaseAPI.class);
        String str1 = "SYS_USER";
        String str2 = "REALNAME";
        String str3 = "USERNAME";
        List list = iSysBaseAPI.queryTableDictItemsByCode(str1, str2, str3);
        this.dictList = list;
        this.filed = paramOnlCgformField.getDbFieldName();
    }


    @Override
    public String converterToVal(String txt) {
        if (oConvertUtils.isEmpty(txt)) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (String str1 : txt.split(",")) {
            String str2 = super.converterToVal(str1);
            if (str2 != null) {

                arrayList.add(str2);
            }
        }
        return String.join(",", arrayList);
    }


    @Override
    public String converterToTxt(String val) {
        if (oConvertUtils.isEmpty(val)) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (String str1 : val.split(",")) {
            String str2 = super.converterToTxt(str1);
            if (str2 != null) {

                arrayList.add(str2);
            }
        }
        return String.join(",", arrayList);
    }
}
